package com.allprs.hmcs.enums;

import com.allprs.hmcs.pojo.resBo.BaseMap;

/**
 * 设备类型枚举
 */
public enum DeviceTypeEnum {

    WATERLOGGING_CAMERA("1", "渍水点摄像头"),

    WARNING_CAMERA("2", "险段摄像头"),

    WATER_CAMERA("3", "内涝点摄像头"),

    CULVERT_CAMERA("4", "涵闸摄像头"),

    WATER_QUILITY("5", "水质水位监测"),

    PONDING_MONITOR("6", "积水液位监测"),

    OBLIQUITY_MONITOR("7", "倾角监测"),

    LANDSLIDE_MONITOR("7", "滑坡位移监测"),

    WISDOM("7", "智慧喷灌"),

    SOIL_MONITOR("7", "土壤监测"),

    ENVIRONMENT_MONITOR("7", "环境监测"),

    DISEASE_MONITOR_MONITOR("7", "病虫害监测"),

    EYE_CAMERA("7", "鹰眼摄像机"),

    FACE_CAMERA("7", "人脸识别摄像机");

    private final String code;
    private final String desc;

    DeviceTypeEnum(String code, String desc)
    {
        this.code = code;
        this.desc = desc;
    }

    public String getCode()
    {
        return code;
    }

    public String getDesc()
    {
        return desc;
    }


    public static String getDescByCode(String code){
        String desc = "";
        for (DeviceTypeEnum ele : values()) {
            if(ele.getCode().equals(code)){
                desc =  ele.getDesc();
            }
        }
        return desc;
    }

    /**
     * 将枚举转换成key-value的vo
     * @return
     */
    public BaseMap toBaseMap() {
        return new BaseMap(code, desc);
    }
}
